<template>
<div class="newsinfo-container">
    <h3 class="title">新闻详情 --- {{ id }}</h3>
    <p class="subtitle">
        <span>发表时间:{{ date | dataFormat }}</span>
        <span>点击:0次</span>
    </p>
    <div class="content">
        <comments-box :id="this.id"></comments-box>
    </div>
</div>
</template>

<script>
import { Toast } from 'mint-ui'
import comment from '../subcomponent/comments.vue'
export default {
    data(){
        return {
            id:this.$route.params.id,
            date:Date.now()
        }
    },
    methods:{
        getNewsInfo(){
            Toast({
                message:'无详细数据',
                duration:2000
            })
        }
    },
    components:{
        'comments-box':comment
    },
    created(){
        this.getNewsInfo()
    }
}
</script>

<style lang="less" scoped>
.newsinfo-container{
    padding: 0 4px;
    .title{
        font-size: 14px;
        text-align: center;
        margin: 10px 0;
    }
    .subtitle{
        border-bottom: 1px solid #cccccc;
        font-size: 12px;
        display: flex;
        justify-content: space-between;
    }
}
</style>